
package com.eworking.eim.packet;

import org.jivesoftware.smack.packet.DefaultPacketExtension;

public class EIMCustomPacketExtension extends DefaultPacketExtension {
    
    /** 确认收到消息 */
    public static final String _RECEIVED = "received";
    
    /** 消息确认回执 */
    public static final String _ACKED = "acked";
    
    public static final String _REQUEST = "request";
    
    public static final String _NAMESPACE = "urn:xmpp:receipts";
    
    public static final String _ID = "id";
    
    public EIMCustomPacketExtension(String name) {
        super(name, _NAMESPACE);
    }
    
    @Override
    public String toXML() {
        StringBuilder sb = new StringBuilder();
        sb.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append("\" ");
        sb.append("id=\"").append(getValue(_ID)).append("\"/>");
        return sb.toString();
    }
}
